package com.example.nacosconsumerpaymemt7777.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author zhaoren
 * @version 1.0
 * @description TODO
 * @date 2020/9/3 9:51
 **/
@RestController
public class StudentController {

    @Autowired
    private RestTemplate restTemplate;

    @Value("${service-url.nacos-user-service}")
    private String MICRO_SERVICE_ID;

    @GetMapping("test")
    public String test(){
        String forObject = restTemplate.getForObject(MICRO_SERVICE_ID + "/student/all", String.class);
        return forObject;
    }
}
